<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script>
$(function(){
	$("#updateBtn").click(function(){
		var rad=$(":radio[name=best]:checked").val();
		if(rad==undefined){
			alert("주차를 선택하세요 !");
			return;
		}
		location.href="admin.do?mode=updateBest&pri="+rad;
		alert("추가완료!");
		
	});
	$("#deleteBtn").click(function(){
		var rad=$(":radio[name=best]:checked").val();
		if(rad==undefined){
			alert("주차를 선택하세요 !");
			return;
		}
		location.href="admin.do?mode=deleteWeekly&pri="+rad;
		alert("삭제완료!");
	});
	
});

</script>

<div align="center">
<input type="button" value="업데이트" id="updateBtn" >
<input type="button" value="삭제" id="deleteBtn" >
</div>
<table border="1">
<tr>
	<td>선택</td>
	<td>년도</td>
	<td>달</td>
	<td>주</td>
	<td>습작</td>
	<td>연작</td>
	<td>작품</td>
</tr>
<c:forEach var="list" items="${requestScope.list }">
<tr>
	<td><input type="radio" name="best" value="${list.bestPrimary }"></td>
	<td>${list.year }</td>
	<td>${list.month}</td>
	<td>${list.week }</td>
	<td>${list.practice }</td>
	<td>${list.series }</td>
	<td>${list.art }</td>	
</tr>
</c:forEach>

</table>



